<html>
<head><meta charset="utf-8"><title>Fallible Allocation · t-libs/wg-allocators · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/index.html">t-libs/wg-allocators</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Fallible.20Allocation.html">Fallible Allocation</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="198322734"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Fallible%20Allocation/near/198322734" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Benjamin Brittain <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Fallible.20Allocation.html#198322734">(May 21 2020 at 13:51)</a>:</h4>
<p>Hey Y'all, what's the current "state of the art" "hip" "newfangled" situation for fallible allocators that aren't just using <code>try_reserve</code>?</p>



<a name="198366893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/197181-t-libs/wg-allocators/topic/Fallible%20Allocation/near/198366893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Tim Diekmann <a href="https://rust-lang.github.io/zulip_archive/stream/197181-t-libs/wg-allocators/topic/Fallible.20Allocation.html#198366893">(May 21 2020 at 19:43)</a>:</h4>
<p>Allocators are fallible in general as every allocating method returns <code>Result&lt;MemoryBlock, AllocErr&gt;</code>. Only the collection types (like <code>Vec</code>) don't forward the result but calls <code>handle_alloc_error</code> instead. Currently it's not fully resolved if we want an associated error type on <code>AllocRef</code>, thus <code>try_reserve</code> is blocked on this decision. See <a href="https://github.com/rust-lang/rust/issues/48043#issuecomment-631054957">#48043 (comment)</a> and the following comments for more information on that.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>